//	@file Version: 1.0
//	@file Name: ADP_F_Watch.sqf
//	@file Author: THumbert
//	@file Created: 12/14/2013
//	@file Description: Watches vars in the Debbugging Panel

private ["_WatchArray","_ResArray","_ctrl","_ResDisplay","_idx","_text","_LastExec","_combined"];
_WatchArray = [1402,1408,1407,1406,1405,1415,1416,1417];
_ResArray = [1403,1409,1410,1411,1404,1413,1401,1414];
_idx = 0;
	{
		_ctrl = _X;
		_ResDisplay = _ResArray select _idx;
		_idx = _idx + 1;
		_text = ctrlText _ctrl;
		_LastExec = format ["%1",_text];
		_result = call compile _text;
		_DEdit = format ["M%1",_x];
		if (isNil "_result") then 
			{
				player setVariable [_DEdit,[_LastExec, "<NULL>"], false];
				ctrlSetText [_ResDisplay, ""];
			} else
			{
				_combined = format["%1",_result];	
				ctrlSetText [_ResDisplay, _combined];
				player setVariable [_DEdit,[_LastExec, _Combined], false];
			};
	} forEach _WatchArray;

